﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.ServiceModel;
using Wicresoft.SelfService.WFHost.Code;

namespace Wicresoft.SelfService.WFHost
{
    public partial class WCFService : ServiceBase
    {
        private ServiceHost _host;
        public WCFService()
        {
            InitializeComponent();
        }

        protected override void OnStart(string[] args)
        {
            if (this._host != null)
            {
                this._host.Close();
            }   

            _host = new ServiceHost(typeof(ApproveFlow));
            _host.Open();
        }

        protected override void OnStop()
        {
            if (this._host != null)
            {
                this._host.Close();
            }   
        }
    }
}
